package com.chixing.day12_date_factory.factory;

/**
 * 该类的作用 用来获得Phone对象
 */
public class PhoneFactory {
    public Phone getPhone(String phoneBrand) {
        Phone phone = null;
        switch (phoneBrand) {
            case "huawei": phone = new HuaweiPhone();break;
            case "oppo": phone = new OppoPhone();break;
            case "vivo": phone = new VivoPhone();break;
            default:phone = null;break;

        }
        return phone;
    }
}
